package game;

import com.jme3.input.controls.InputListener;

public abstract class InputController {
    protected static MyInputListener currentGameInput;
    protected static boolean inputPaused = false;
    
    public static void setCurrentGameInput(MyInputListener input) {
        if(currentGameInput != null)
            DataStore.inputManager.removeListener((InputListener)currentGameInput);
        currentGameInput = input;
        if(!inputPaused)
            currentGameInput.register();
    }
    
    public static void pauseCurrentGameInput() {
        DataStore.inputManager.removeListener((InputListener)currentGameInput);
        inputPaused = true;
    }
    
    public static void unpauseCurrentGameInput() {
        currentGameInput.register();
        inputPaused = false;
    }
}
